import { createApp } from 'vue';
import { createPinia } from 'pinia';
import AntdV from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import router from "./router.js";
import '@ant-design/icons-vue'
import i18nPlugin from "@/plugins/i18n.js";
import App from './App.vue';
import { myPiniaPlugin } from "@stores/myPiniaPlugin.js";


const pinia = createPinia();
const app = createApp( App );
app.use( router );
app.use( AntdV );

// 安装pinia插件
pinia.use(myPiniaPlugin);

app.use( pinia );

// 移除所有aria-hidden属性
app.directive( "removeAriaHidden", {
	bind : function ( el ) {
		const ariaEls = el.querySelectorAll( "[aria-hidden]" );
		ariaEls.forEach( function ( el ) {
			el.removeAttribute( "aria-hidden" );
		} );
	}
} );
app.use(i18nPlugin, {
	greetings : {
		hello : '你好'
	}
})
// 挂载到全局
app.mount( '#app' );

